package com.teaphy.coroutinecrawler.flow.operators

import kotlinx.coroutines.*
import kotlinx.coroutines.channels.BufferOverflow
import kotlinx.coroutines.flow.*

fun main() = runBlocking {
    val count = flow {
        for (value in 0..3) {
            println("emit - $value")
            emit(value)
            delay(100)
        }
    }.count()

    println("Flow 发出的元素数量 count - $count")
}